package com.outsource.framework.model.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import com.outsource.framework.domain.Tuserflow;

public interface TuserflowRepository extends CrudRepository<Tuserflow, Integer>, JpaSpecificationExecutor<Tuserflow>{

	@Query(value="select * from t_userflow where id = :id",nativeQuery = true)
	Tuserflow getById(@Param("id")Integer id);
	@Query(value="select * from t_userflow where mobile = :mobile and month = :month order by updatetime asc",nativeQuery = true)
	List<Tuserflow> findByAllflows(@Param("mobile")String mobile,@Param("month")String month);
	@Query(value="select * from t_userflow where mobile = :mobile and month = :month and date = :dates order by updatetime asc",nativeQuery = true)
	Tuserflow getByflows(@Param("mobile")String mobile,@Param("month")String month,@Param("dates")String dates);
	
}
